.class Lcom/netease/newsreader/activity/SelectColumn$3;
.super Ljava/lang/Object;
.source "SelectColumn.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/netease/newsreader/activity/SelectColumn;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/netease/newsreader/activity/SelectColumn;


# direct methods
.method constructor <init>(Lcom/netease/newsreader/activity/SelectColumn;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    .line 244
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 14
    .parameter "v"

    .prologue
    .line 250
    iget-object v11, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    iget-object v11, v11, Lcom/netease/newsreader/activity/SelectColumn;->db:Landroid/database/sqlite/SQLiteDatabase;

    const-string v12, "delete from more_columns"

    invoke-virtual {v11, v12}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 252
    const/4 v5, 0x0

    .local v5, i:I
    :goto_0
    iget-object v11, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    invoke-static {v11}, Lcom/netease/newsreader/activity/SelectColumn;->access$5(Lcom/netease/newsreader/activity/SelectColumn;)Landroid/widget/ListView;

    move-result-object v11

    invoke-virtual {v11}, Landroid/widget/ListView;->getCount()I

    move-result v11

    if-lt v5, v11, :cond_0

    .line 283
    new-instance v6, Landroid/content/Intent;

    iget-object v11, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    const-class v12, Lcom/netease/newsreader/activity/CustomColumn;

    invoke-direct {v6, v11, v12}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 284
    .local v6, intent:Landroid/content/Intent;
    const/high16 v11, 0x400

    invoke-virtual {v6, v11}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 285
    iget-object v11, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    invoke-virtual {v11, v6}, Lcom/netease/newsreader/activity/SelectColumn;->startActivity(Landroid/content/Intent;)V

    .line 286
    return-void

    .line 253
    .end local v6           #intent:Landroid/content/Intent;
    :cond_0
    iget-object v11, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    invoke-static {v11}, Lcom/netease/newsreader/activity/SelectColumn;->access$5(Lcom/netease/newsreader/activity/SelectColumn;)Landroid/widget/ListView;

    move-result-object v11

    invoke-virtual {v11, v5}, Landroid/widget/ListView;->getItemAtPosition(I)Ljava/lang/Object;

    move-result-object v8

    .line 254
    .local v8, o:Ljava/lang/Object;
    instance-of v11, v8, Ljava/util/HashMap;

    if-eqz v11, :cond_2

    .line 256
    :try_start_0
    move-object v0, v8

    check-cast v0, Ljava/util/HashMap;

    move-object v11, v0

    const-string v12, "tname"

    invoke-virtual {v11, v12}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    .line 257
    .local v7, name:Ljava/lang/String;
    move-object v0, v8

    check-cast v0, Ljava/util/HashMap;

    move-object v11, v0

    const-string v12, "tid"

    invoke-virtual {v11, v12}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v10

    .line 258
    .local v10, tid:Ljava/lang/String;
    move-object v0, v8

    check-cast v0, Ljava/util/HashMap;

    move-object v11, v0

    const-string v12, "cid"

    invoke-virtual {v11, v12}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    .line 260
    .local v2, cid:Ljava/lang/String;
    check-cast v8, Ljava/util/HashMap;

    .end local v8           #o:Ljava/lang/Object;
    const-string v11, "checkbox"

    invoke-virtual {v8, v11}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/HashMap;

    .line 262
    .local v1, checkbox_map:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v9, "select * from top_columns where tname=?"

    .line 264
    .local v9, sql:Ljava/lang/String;
    iget-object v11, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    iget-object v11, v11, Lcom/netease/newsreader/activity/SelectColumn;->db:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v12, 0x1

    new-array v12, v12, [Ljava/lang/String;

    const/4 v13, 0x0

    aput-object v7, v12, v13

    invoke-virtual {v11, v9, v12}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v3

    .line 266
    .local v3, cursor:Landroid/database/Cursor;
    const-string v11, "checkbox_status"

    invoke-virtual {v1, v11}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v11

    const-string v12, "true"

    invoke-virtual {v11, v12}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v11

    if-eqz v11, :cond_3

    .line 267
    if-eqz v3, :cond_1

    invoke-interface {v3}, Landroid/database/Cursor;->getCount()I

    move-result v11

    if-nez v11, :cond_2

    .line 268
    :cond_1
    const-string v11, "more_columns"

    iget-object v12, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    iget-object v12, v12, Lcom/netease/newsreader/activity/SelectColumn;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-static {v11, v12, v7, v10, v2}, Lcom/netease/newsreader/util/Tools;->insertDataToDB(Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 252
    .end local v1           #checkbox_map:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .end local v2           #cid:Ljava/lang/String;
    .end local v3           #cursor:Landroid/database/Cursor;
    .end local v7           #name:Ljava/lang/String;
    .end local v9           #sql:Ljava/lang/String;
    .end local v10           #tid:Ljava/lang/String;
    :cond_2
    :goto_1
    add-int/lit8 v5, v5, 0x1

    goto/16 :goto_0

    .line 271
    .restart local v1       #checkbox_map:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .restart local v2       #cid:Ljava/lang/String;
    .restart local v3       #cursor:Landroid/database/Cursor;
    .restart local v7       #name:Ljava/lang/String;
    .restart local v9       #sql:Ljava/lang/String;
    .restart local v10       #tid:Ljava/lang/String;
    :cond_3
    if-eqz v3, :cond_2

    invoke-interface {v3}, Landroid/database/Cursor;->getCount()I

    move-result v11

    if-lez v11, :cond_2

    .line 272
    iget-object v11, p0, Lcom/netease/newsreader/activity/SelectColumn$3;->this$0:Lcom/netease/newsreader/activity/SelectColumn;

    iget-object v11, v11, Lcom/netease/newsreader/activity/SelectColumn;->db:Landroid/database/sqlite/SQLiteDatabase;

    new-instance v12, Ljava/lang/StringBuilder;

    const-string v13, "delete from top_columns where tname=\'"

    invoke-direct {v12, v13}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 273
    invoke-virtual {v12, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    const-string v13, "\'"

    invoke-virtual {v12, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    .line 272
    invoke-virtual {v11, v12}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    .line 276
    .end local v1           #checkbox_map:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    .end local v2           #cid:Ljava/lang/String;
    .end local v3           #cursor:Landroid/database/Cursor;
    .end local v7           #name:Ljava/lang/String;
    .end local v9           #sql:Ljava/lang/String;
    .end local v10           #tid:Ljava/lang/String;
    :catch_0
    move-exception v4

    .line 278
    .local v4, e:Ljava/lang/Exception;
    invoke-virtual {v4}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1
.end method
